/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.helper;

import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Administrator
 */
public class BooleanTableModel extends AbstractTableModel {

    Object[] columns = {"STUDENT ID", "NAME", "SCORE", "PASSED"};
    Object[][] data = {
        {"S001", "ALICE", 90.00, Boolean.TRUE},
        {"S002", "BOB", 45.50, Boolean.FALSE},
        {"S003", "CAROL", 60.00, Boolean.FALSE},
        {"S004", "MALLORY", 75.80, Boolean.TRUE}
    };

    public BooleanTableModel(Object[][] isi, Object[] judul) {
        this.columns = judul;
        this.data = isi;
    }

    @Override
    public int getRowCount() {
        return data.length;
    }

    @Override
    public int getColumnCount() {
        return columns.length;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        return data[rowIndex][columnIndex];
    }

    @Override
    public String getColumnName(int column) {
        return (String) columns[column];
    }

    @Override
    public Class<?> getColumnClass(int columnIndex) {
        return data[0][columnIndex].getClass();
    }
}
